/**
 * @description 原地排序，不使用sort，荷兰国旗问题
 * @param {number[]} nums
 * @return {void} Do not return anything, modify nums in-place instead.
 */
var sortColors = function (nums) {
    var arr = [...nums];
    nums.splice(0, nums.length);
    nums.push(...arr.filter(v => v === 0), ...arr.filter(v => v === 1), ...arr.filter(v => v === 2));
    console.log(nums);
};
sortColors([2, 0, 2, 1, 1, 0])